package com.dashu.base.enums.common;


import java.util.HashMap;
import java.util.Map;

public enum Status {

    UNINITIALIZED("未初始化"),
    INITIALIZATION("初始化"),
    UNDERREVIEW("审核中"),
    REVIEWED("已审核"),
    AUDITFAILED("审核失败"),
    ERROR("数据异常");


    public String name;

    Status(String name) {
        this.name = name;
    }

    public static Status getStatus(String name) {
        switch (name) {
            case "UNINITIALIZED":
                return UNINITIALIZED;
            case "INITIALIZATION":
                return INITIALIZATION;
            case "UNDERREVIEW":
                return UNDERREVIEW;
            case "REVIEWED":
                return REVIEWED;
            case "AUDITFAILED":
                return AUDITFAILED;
            case "ERROR":
                return ERROR;
        }
        return null;
    }


    public static final Map<String, Status> map = new HashMap<>();

    static {
        for (Status s : Status.values()) {
            map.put(s.name(), s);
        }
    }
}
